let str2 = 'aaa,bbb,ccc,ddd'
let reg = new RegExp('bbb,')
let a = str2.replace(reg, '')
console.log(a)

const ac  = [
    {
        "action":"$N身影陡转，如鬼魅般忽前忽后，瞬左瞬右，一式「徘徊空谷」掌风已至$n的$l",
        "lvl" : 0,
        "skill_name" : "徘徊空谷",
        "damage_type" : "瘀伤"
    },{
        "action":"$N身影陡转，如鬼魅般忽前忽后，瞬左瞬右，一式「徘徊空谷」掌风已至$n的$l",
        "lvl" : 0,
        "skill_name" : "徘徊空谷",
        "damage_type" : "瘀伤"
    },{
        "action":"$N身影陡转，如鬼魅般忽前忽后，瞬左瞬右，一式「徘徊空谷」掌风已至$n的$l",
        "lvl" : 0,
        "skill_name" : "徘徊空谷",
        "damage_type" : "瘀伤"
    },
    {
        "action":"$N长叹一声，身形凝重，一招「力不从心」，诱得$n全力进击之际，反手直拍$n的$l",
        "lvl" : 15,
        "skill_name" : "力不从心",
        "damage_type" : "瘀伤"
    }
    ]
// for(let i in ac) {
// console.log(ac[i]['lvl'])
// }
let mapped =  {
    strike: {
        name:'anran-zhang',
        level:799
    },
    parry: {
        name:'anran-zhang',
            level:800
    },
    force: {
        name:'yunv-xinjing',
            level:300
    }
}
// console.log(mapped.strike['name'])


// 删除数据
let obj = {
    aa:1,
    bb:2,
    cc:{
        ddd:1
    }
}
let aaa = 'zhanghsa';
let bbb = 'lssds-adsad';
obj.temp={};
obj.temp[aaa] = bbb;
console.log(obj)
// console.log(obj)
// delete obj.cc.ddd;
// console.log(obj)
// 不改变原对象
// let {aa, ...ooo} = obj
// obj = ooo;
// console.log(obj)

// for (let i in obj) {
//     console.log(i)
//     if (i=='aa') break;
//     switch (i) {
//         case 'aa':
//             break;
//         case 'bb':
//             break;
//     }
// }

// 加密
const crypto = require('crypto');
let str = '614741a61204982';
const password = 'ZShL88DzjqXhpAi8';
const iv = 'ZShL88DzjqXhpAi8';
console.log(str.length)

const cipher = crypto.createCipheriv('aes-128-cbc', password, iv);
cipher.update(str,'utf8', 'hex')
let data3 = cipher.final('hex');
console.log(data3);

// 解密
const decipher = crypto.createDecipheriv('aes-128-cbc', password, iv);
decipher.update(data3, 'hex', 'utf8')
let data4 = decipher.final().toString();
console.log(data4);

const abc = ['a','b','c']
abc.map((item,k)=>{
    console.log(item)
})